// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.asm;

import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class ClassDebugInfoRemover extends ClassAdapter {

  public ClassDebugInfoRemover(ClassVisitor out) {
    super(out);
  }

  @Override
  public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
    return null;
  }

  @Override
  public void visitAttribute(Attribute attr) {
  }
  
  

  @Override
  public void visitSource(String source, String debug) {
  }

  @Override
  public MethodVisitor visitMethod(int access, String name, String desc, String signature,
      String[] exceptions) {
    MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions);
    if (visitor != null) {
      visitor = new MethodDebugInfoRemover(visitor);
    }
    return visitor;
  }
}
